package org.chickymate.scrumboard.server;

import org.chickymate.scrumboard.client.model.Board;
import org.chickymate.scrumboard.client.model.repository.BoardRepository;
import org.chickymate.scrumboard.client.model.repository.BoardRepositoryImpl;
import org.chickymate.scrumboard.client.service.BoardService;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class BoardServiceImpl extends RemoteServiceServlet implements
		BoardService {

	@Override
	public Board getUserBoard(String userMail) {
		BoardRepository boardRepository = new BoardRepositoryImpl();
		return boardRepository.getBoard(userMail);
		
	}

	@Override
	public void createNewBoard(String userMailAddress, String projectName) {
		BoardRepository boardRepository = new BoardRepositoryImpl();
		Board board = new Board(userMailAddress);
		board.setProjectName(projectName);
		boardRepository.save(board);
		
	}

}
